/*
 * COAPI - Copyright (C) 2019-2020 Cocheer Tech. Co., Ltd.
 * All rights reserved
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _COAPI_WIRELESS_H_
#define _COAPI_WIRELESS_H_

#ifdef __cplusplus
extern "C" {
#endif
/**
 * @used: 无线指令的个数
 * @data: 无线指令数据json
 */
typedef struct {
    int used;
    char *data;
} wireless_info;

/*
 * 语音上传应答回调函数
 * @wireless 返回的无线指令结果信息
 * @status 返回的状态 0: 无，1: 正常返回, 其他： 错误码
 **/
typedef void (*wireless_resp_cb)(wireless_info *info, int status);

/**
 * @brief 初始化无线指令获取接口
 * @resp_cb 获取无线指令结果回调函数
 * @return 0: success, -1: fail
 */
int coapi_wireless_init(wireless_resp_cb cb);

/**
 * @brief 无线指令获取接口
 * @used 发送无线指令的个数
 * @data 无线指令数据(json)
 * @return 0: success, -1: fail
 **/
int coapi_wireless_start(int used, char *data);

#ifdef __cplusplus
} /* "C" */
#endif

#endif
